package com.itsu.manage.interceptor;

import com.itsu.interfaces.entity.ManageUser;

public class UserThreadLocal {

    private static final ThreadLocal<ManageUser> USER_THREAD_LOCAL =  new ThreadLocal<>();

    public static void set(ManageUser manageUser) {
        USER_THREAD_LOCAL.set(manageUser);
    }

    public static ManageUser get() {
        return USER_THREAD_LOCAL.get();
    }

    public static void remove() {
        USER_THREAD_LOCAL.remove();
    }

    public static Long getUid() {
        return USER_THREAD_LOCAL.get().getId();
    }

    public static String getMobile() {
        return USER_THREAD_LOCAL.get().getUsername();
    }
}
